import type { CartItem } from '@/types/cart'
import { http } from '@/utils/http'
/**
 * 留言
 * @param data 请求体参数
 */
export const postMessageAPI = (data: { doctorId: string; msg: number; userId:string }) => {
  return http({
    method: 'POST',
    url: '/user/patient/send',
    data,
  })
}
/**
 * 获取未回复信息列表
 */
export const getMessegeAPI = (userId: any) => {
  return http<CartItem[]>({
    method: 'GET',
    url: `/user/user/noReply/${userId}`,
    data:userId
  })
}
// 查询当前信息
export const getMessageAPIid = (messageId:any) => {
  return http({
    method:'GET',
    url:`/user/user/message/${messageId}`,
    data:messageId
  })
}
// 回复消息
export const ReplyMessage = (data:any) => {
  return http({
    method:'POST',
    url:'/user/user/reply',
    data
  })
}
// 已回复消息列表
export const ReplyMessageAPI = (userId:any) => {
  return http({
    method:'GET',
    url:`/user/user/reply/${userId}`,
    data:'userID'
  })
}
// 用户回复
export const NoReplyMessageAPI = (data:any) => {
  return http({
    method:'POST',
    url:'/user/user/send',
    data
  })
}
// AI
export const AIReplyMessageAPI = (recordOriginalId:any) => {
  return http({
    method:'GET',
    url:`/user/user/recordAnalysis/${recordOriginalId}`,
    data:recordOriginalId
  })
}
/**
 * 删除/
 * @param data 请求体参数 ids SKUID 集合
 */
export const deleteMemberCartAPI = (data: { ids: string[] }) => {
  return http({
    method: 'DELETE',
    url: '/member/cart',
    data,
  })
}
/**
 * 修改
 * @param skuId SKUID
 * @param data selected 选中状态 count 数量*/
export const putMemberCartBySkuIdAPI = (
  skuId: string,
  data: { selected?: boolean; count?: number },
) => {
  return http({
    method: 'PUT',
    url: `/member/cart/${skuId}`,
    data,
  })
}
/**
 * 全选/取消全选
 * @param data selected 是否选中
 */
export const putMemberCartSelectedAPI = (data: { selected: boolean }) => {
  return http({
    method: 'PUT',
    url: '/member/cart/selected',
    data,
  })
}
